package entity

import (
	"time"
)

// User [...]
type User struct {
	ID        uint64    `gorm:"primaryKey;column:id" json:"-"`
	CreatedAt time.Time `gorm:"column:created_at" json:"createdAt"`
	UpdatedAt time.Time `gorm:"column:updated_at" json:"updatedAt"`
	Name      string    `gorm:"column:name" json:"name"`         // 用户账户
	Nickname  string    `gorm:"column:nickname" json:"nickname"` // 昵称
	Password  string    `gorm:"column:password" json:"password"` // 密码
	Email     string    `gorm:"column:email" json:"email"`       // 邮箱
	Phone     string    `gorm:"column:phone" json:"phone"`       // 手机号
	Status    int8      `gorm:"column:status" json:"status"`     // 状态
	Creator   uint64    `gorm:"column:creator" json:"creator"`
}

// TableName get sql table name.获取数据库表名
func (m *User) TableName() string {
	return "user"
}

// UserColumns get sql column name.获取数据库列名
var UserColumns = struct {
	ID        string
	CreatedAt string
	UpdatedAt string
	Name      string
	Nickname  string
	Password  string
	Email     string
	Phone     string
	Status    string
	Creator   string
}{
	ID:        "id",
	CreatedAt: "created_at",
	UpdatedAt: "updated_at",
	Name:      "name",
	Nickname:  "nickname",
	Password:  "password",
	Email:     "email",
	Phone:     "phone",
	Status:    "status",
	Creator:   "creator",
}
